import request from '@/utils/request'

// 查询基础资料 供应商分类列表
export function listCategory(query) {
    return request({
        url: '/base/supplierCategory/list',
        method: 'get',
        params: query
    })
}

// 查询基础资料 供应商分类详细
export function getCategory(supplierCategoryId) {
    return request({
        url: '/base/supplierCategory/' + supplierCategoryId,
        method: 'get'
    })
}

// 新增基础资料 供应商分类
export function addCategory(data) {
    return request({
        url: '/base/supplierCategory',
        method: 'post',
        data: data
    })
}

// 修改基础资料 供应商分类
export function updateCategory(data) {
    return request({
        url: '/base/supplierCategory',
        method: 'put',
        data: data
    })
}

// 删除基础资料 供应商分类
export function delCategory(supplierCategoryId) {
    return request({
        url: '/base/supplierCategory/' + supplierCategoryId,
        method: 'delete'
    })
}
// 查询基础资料 供应商列表
export function listSupplier(query) {
    return request({
        url: '/base/supplier/list',
        method: 'get',
        params: query
    })
}

// 查询基础资料 供应商详细
export function getSupplier(supplierId) {
    return request({
        url: '/base/supplier/' + supplierId,
        method: 'get'
    })
}

// 新增基础资料 供应商
export function addSupplier(data) {
    return request({
        url: '/base/supplier',
        method: 'post',
        data: data
    })
}

// 修改基础资料 供应商
export function updateSupplier(data) {
    return request({
        url: '/base/supplier',
        method: 'put',
        data: data
    })
}

// 删除基础资料 供应商
export function delSupplier(supplierId) {
    return request({
        url: '/base/supplier/' + supplierId,
        method: 'delete'
    })
}
//供应商下拉数据
export function getSupplierOption() {
    return request({
        url: '/base/supplier/dropList',
        method: 'get',
        params:{supplierCategoryId:1}
    })
}